<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>京东商城--注册</title>
	<hdjs/>
	<link rel="stylesheet" href="__TEMPLATE__/css/css.css">
</head>
<body>
	<div id="reg_box">
		<div id="reg_reg">
			<form action="" method="post">
				<table>
					<tr>
						<td><input type="text" name="username" class="username"></td>
					</tr>
					<tr>
						<td><input type="password" name="password" class="username"></td>
					</tr>
					<tr>
						<td><input type="password" name="repassword" class="username"></td>
					</tr>
					<tr>
						<td><input type="text" name="code" class="yanzheng"><img src="{|U:'reg/code'}" alt="" onclick="change()" id="code"><span name="hd_code"></span></td>
					</tr>
				</table>
				<input type="submit" value="" class="but">
			</form>
		</div>
	</div>
</body>
<script type="text/javascript">
	$('form').validate({
		username:{
			rule:{required:true,minlen:6},
			error:{required:'用户名不能为空',minlen:'不能少于6位'}
		},
		password:{
			rule:{required:true,minlen:6},
			error:{required:'密码不能为空',minlen:'不能少于6位'}
		},
		repassword:{
			rule:{required:true,
				confirm: "password"},
			error:{required:'密码不能为空',confirm: '确认密码输入错误'}
		},
		code:{
			rule:{
				required:true,
				ajax:{url:CONTROLLER+"&a=checkCode"}
			},
			error:{
				required:'验证码不能为空',
				ajax:'验证码输入错误'
			}
		}
	})
	//更换验证码
function change(){
	$("#code").attr('src',CONTROLLER+"&a=code&_"+Math.random());
}
</script>
</html>